#include "ToolBarVisualAngle.h"
#include "CFDPost/CFDPostUtils/CFDPostSigsCenter.h"

namespace GUI {

    ToolBarVisualAngle::ToolBarVisualAngle(SARibbonPannel* pannel): ToolBarBase(pannel) {
        CFDPostSigsCenter* pPostSigCenter = CFDPostSigsCenter::getInstance();

        m_pViewAutoAction = createAction(tr("Auto"), m_strViewAutoActionName, ":FITKIcons/icoR_autofit.png", tr("Auto"));
        addAction(m_pViewAutoAction);
        
        m_pViewFrontAction = createAction(tr("Z+"),m_strViewFrontActionName, ":FITKIcons/icoR_viewFront.svg", tr("Front"));
        addAction(m_pViewFrontAction);
        
        m_pViewBackAction = createAction(tr("Z-"),m_strViewBackActionName, ":FITKIcons/icoR_viewBack.svg", tr("Back"));
        addAction(m_pViewBackAction);
       
        m_pViewTopAction = createAction(tr("Y+"),m_strViewTopActionName, ":FITKIcons/icoR_viewTop.svg", tr("Top"));
        addAction(m_pViewTopAction);
       
        m_pViewBottomAction = createAction(tr("Y-"),m_strViewBottomActionName, ":FITKIcons/icoR_viewBottom.svg", tr("Bottom"));
        addAction(m_pViewBottomAction);
        
        m_pViewLeftAction = createAction(tr("X+"),m_strViewLeftActionName, ":FITKIcons/icoR_viewLeft.svg", tr("Left"));
        addAction(m_pViewLeftAction);
        
        m_pViewRightAction = createAction(tr("X-"),m_strViewRightActionName, ":FITKIcons/icoR_viewRight.svg", tr("Right"));
        addAction(m_pViewRightAction);
        
        m_pViewIsoAction = createAction(tr("Iso"),m_strViewIsoActionName, ":FITKIcons/icoR_viewIso.svg", tr("Iso"));
        addAction(m_pViewIsoAction);
        
        updateCurrentGraphObj(-1);
    }

    ToolBarVisualAngle::ToolBarVisualAngle(SARibbonPannel* pannel, QVector<QString> actionNames) : ToolBarBase(pannel)
    {
        if (actionNames.size() == 8)
        {
            m_strViewAutoActionName = actionNames[0];
            m_strViewFrontActionName = actionNames[1];
            m_strViewBackActionName = actionNames[2];
            m_strViewTopActionName = actionNames[3];
            m_strViewBottomActionName = actionNames[4];
            m_strViewLeftActionName = actionNames[5];
            m_strViewRightActionName = actionNames[6];
            m_strViewIsoActionName = actionNames[7];
        }

        m_pViewAutoAction = createAction(tr("Auto"), m_strViewAutoActionName, ":FITKIcons/icoR_autofit.png", tr("Auto"));
        addAction(m_pViewAutoAction);

        m_pViewFrontAction = createAction(tr("Z+"), m_strViewFrontActionName, ":FITKIcons/icoR_viewFront.svg", tr("Front"));
        addAction(m_pViewFrontAction);

        m_pViewBackAction = createAction(tr("Z-"), m_strViewBackActionName, ":FITKIcons/icoR_viewBack.svg", tr("Back"));
        addAction(m_pViewBackAction);

        m_pViewTopAction = createAction(tr("Y+"), m_strViewTopActionName, ":FITKIcons/icoR_viewTop.svg", tr("Top"));
        addAction(m_pViewTopAction);

        m_pViewBottomAction = createAction(tr("Y-"), m_strViewBottomActionName, ":FITKIcons/icoR_viewBottom.svg", tr("Bottom"));
        addAction(m_pViewBottomAction);

        m_pViewLeftAction = createAction(tr("X+"), m_strViewLeftActionName, ":FITKIcons/icoR_viewLeft.svg", tr("Left"));
        addAction(m_pViewLeftAction);

        m_pViewRightAction = createAction(tr("X-"), m_strViewRightActionName, ":FITKIcons/icoR_viewRight.svg", tr("Right"));
        addAction(m_pViewRightAction);

        m_pViewIsoAction = createAction(tr("Iso"), m_strViewIsoActionName, ":FITKIcons/icoR_viewIso.svg", tr("Iso"));
        addAction(m_pViewIsoAction);

        updateCurrentGraphObj(-1);
    }

    void ToolBarVisualAngle::updateCurrentGraphObj(int objID) {
        _currentDataID = objID;
    }
}
